<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUser extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
            Schema::create('users', function (Blueprint $table) {
                $table->increments('id');
                $table->string('username');
                $table->string('password')->nullable();
                $table->string('img')->comment('头像');
                $table->string('email')->comment('邮箱');
                $table->tinyInteger('age')->unsigned();
                $table->tinyInteger('aaa')->unsigned();

                $table->timestamps();
            });
        // }else{
        //     Schema::table('users', function ($table) {
        //         //添加b字段
        //         if (!Schema::hasColumn('users', 'b')) {
        //             //
        //             $table->string('b');
        //         }

        //         if (!Schema::hasColumn('users', 'c')) {
        //             //
        //             $table->string('c');
        //         }

                //检测  
        
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        //
    }
}
